﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Escalation.aspx.cs" Inherits="TicketM.Configuration.Escalation" MasterPageFile="./ConfigSite.Master" %>


<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>Ticketing Application Configuration Manager</h1>
            </hgroup>
            <nav>
                <ul id="lmenu">
                    <li><a id="A1" runat="server" href="Configuration.aspx">Servers and Accounts</a></li>
                    <li><a id="A2" runat="server" href="Routing.aspx">Conditional Assignment</a></li>
                    <li><a id="A3" runat="server" href="Products.aspx">Products List</a></li>
                    <li><a id="A4" runat="server" href="#"><span style="color: darkslategray">Escalation</span></a></li>
                </ul>
            </nav>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <table border="1">
        <tr style="border-bottom:solid;border-bottom-color:darkgrey">
            <td style="border-right:solid;border-right-color:darkgrey;width:300px"><asp:Label runat="server" ID="AreaLbl" text="Area"/></td>
            <td style="border-right:solid;border-right-color:darkgrey;padding-left:10px"> <asp:Label runat="server" text="Days before escalation" /></td>
            <td style="padding-left:10px"><asp:Label runat="server" Text="Email for Escalation" /></td>
            </tr>
        <tr style="border-bottom:solid;border-bottom-color:darkgrey">
            <td style="border-right:solid;border-right-color:darkgrey"><asp:Label runat="server" ID="Area" /></td>
            <td style="border-right:solid;border-right-color:darkgrey;padding-left:10px">
                <asp:TextBox runat="server" ID="EscDays" Width="30" OnTextChanged="EscDays_TextChanged" AutoPostBack="true"/>
            </td>
            <td style="padding-left:10px">
                <asp:DropDownList runat="server" DataSourceID="ObjectDataSource1" Width="300px" AutoPostBack="true" ID="EscEmail" OnSelectedIndexChanged="EscEmail_SelectedIndexChanged">
                    
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetTeamMembersEmails" TypeName="TicketM.Models.Tickets">
                    <SelectParameters>
                        <asp:SessionParameter Name="sProject" SessionField="sProject" Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:GridView ID="GridView1" runat="server" EnableViewState="False" AutoGenerateColumns="False" DataSourceID="AreaEscalationXml" CellPadding="4" ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" Width="596px">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="Days" HeaderText="Days" />
                        <asp:BoundField DataField="Email" HeaderText="Email" />
                        <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
            </td>
            <td><asp:Button runat="server" Text="Save" OnClick="SaveButton_Click" ID="SaveButton" width="115px" Enabled="false"/>
                <br />
                <br />
                <asp:Button runat="server" ID="SyncBackButton" OnClick="SyncBackButton_Click" Text="Sync Back" Width="115px" Enabled="false" Visible="false"/>
                <br />
                <br />
                <asp:Label ID="result" runat="server" />
            </td>
        </tr>
    </table>
    <asp:XmlDataSource ID="AreaEscalationXml" runat="server" DataFile="~/App_Data/AreaNoDaysEmails.xml" EnableCaching="False"></asp:XmlDataSource>
</asp:Content>
